import sys,os

objects = ['pa_convert.c', 'pa_trace.c', 'pa_lib.c']

env = Environment()

if 'win' in sys.platform:
    SDK = 'C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0\\'
    
    # Include
    env.Append(CPPPATH = SDK + 'Include;')
    env.Append(CPPPATH = SDK + 'VC\\INCLUDE;')
    
    # Library Path
    env.Append(LIBPATH = SDK + 'Lib;')
    env.Append(LIBPATH = SDK + 'VC\\LIB;')

    # Libraries
    env.Append(LIBS = 'WinMM')
    
    # Objects
    objects.append('pa_win\\pa_win_wmme.c')
    
    # Compiler Flags
    env.Append(CCFLAGS ='/TP /GR /EHsc /DWINDOWS')

    # Shared Library
    lib = env.SharedLibrary('portaudio', objects)
elif 'linux' in sys.platform:
    # Include
    env.Append(CPPPATH = '/usr/include:.')

    # Library Path
    env.Append(LIBPATH = '/usr/lib:')

    # Objects
    objects.append('pa_unix/pa_unix.c')
    objects.append('pa_unix/pa_unix_oss.c')

    # Compiler Flags
    env.Append(CCFLAGS ='-Wall')
    lib = env.StaticLibrary('portaudio', objects)
